<?php
$cid        = gpc_getStringArray('cid');
$name       = "";

if(count($cid)==0)
{
    $cid[0]=$id;
}

foreach($cid as $id)
{
    //---------------Lay thong tin ve gallery sap xoa
    $sql_select = "SELECT cName,iParentId FROM tblvideo WHERE iId = $id";
    $rs=$dbsql->query($sql_select);
    if($result = $dbsql->fetch_array($rs))
    {
    	$name       .= $result["cName"].", ";
    	$idparent    =$result['iParentId'];
    }
    //--------------Xoa gallery da duoc chi dinh
    $sql_delete = "DELETE FROM tblvideo WHERE iId = $id";
    $dbsql->query($sql_delete);
}

$msg = "Delete Videos success !";
$pagetr = empty($pagetr) ? "id=$idparent" : $pagetr;
page_transfer($msg,$pagetr);
exit();
?>